﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xilium.CefGlue.Demo.Browser
{
    class CefWebContextMenuHandler : CefContextMenuHandler
    {

        private readonly WebBrowser _core;

        public CefWebContextMenuHandler(WebBrowser core)
        {
            _core = core;
        }

        protected override void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams state, CefMenuModel model)
        {

            model.Clear();
        }


        //protected override bool OnContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams state, int commandId, CefEventFlags eventFlags)
        //{
        //    //var myBrowser = browser as CeBrowser;

        //    if (commandId == 90001)
        //    {
        //        var handle = _core.OnPopupWindow(state.LinkUrl);
        //        if (handle)
        //            return true;
        //    }

        //    return base.OnContextMenuCommand(browser, frame, state, commandId, eventFlags);
        //}
    }
}
